#ifndef _BSP_H_
#define _BSP_H_


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "esp_log.h"

#include "freertos/queue.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_netif.h"

//#include "esp_random.h"


#include "esp_utils.h"
#include "esp_storage.h"
#include "espnow.h"

#include "driver/uart.h"


#include "bsp_button.h"
#include "bsp_light.h"
#include "bsp_ws2812.h"
//#include "bsp_w5500.h"
//#include "bsp_rs485.h"
#include "bsp_temperature.h"
#include "bsp_protocol.h"


typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned u32;

#ifndef FALSE
#define FALSE 0
#endif

#ifndef TRUE
#define TRUE 1
#endif

typedef struct APPSTRUCT
{
	u16		wCheckSum;/*检验和(后面数据的字节和)*/

    uint8_t Tosop_Is_CONNECT_FLAG;//此设备是否组网成功标志 组网成功==1 没组网==0

    //定义一些全局变量参数
    uint8_t Tosop_Edu_Channel;//自定义的espnow通道，默认是8通道
    uint8_t Tosop_Edu_Row;//自定义的行数，默认是3行
    uint8_t Tosop_Edu_column;//自定义的列数，默认是3列


}AppStruct;


AppStruct App;
AppStruct App_Ram;//运行在ram中的拷贝

void Tospo_bsp_init(void);
u8 Tospo_DataBase_Save(void);

#endif
